import { _decorator, Component, Label, Node, Sprite } from 'cc';
import { Soldier } from '../entity/Soldier';
const { ccclass, property } = _decorator;

@ccclass('ArmyCountItem')
export class ArmyCountItem extends Component {
    @property(Sprite)
    cover:Sprite
    @property(Label)
    soldierName:Label
    @property(Label)
    count:Label

    start() {

    }

    async setData(soldier:Soldier) {
        this.soldierName.string = soldier.name
        this.count.string = soldier.count + ''
        this.cover.spriteFrame = await soldier.getHeadImg()
    }
}


